package com.wonders;

import com.pojo.A;
import com.pojo.D;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

public class ImportBeanDefinitionRegistrarDImpl implements ImportBeanDefinitionRegistrar {
    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
        // 初始化bean的基本信息（默认是单例）
        RootBeanDefinition rootBeanDefinition = new RootBeanDefinition(D.class);
        // 注册一个名称
        registry.registerBeanDefinition("D", rootBeanDefinition);
    }
}
